<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\User\UserController;


/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/getToken',[LoginController::class,'getToken']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::post('/upload',[LoginController::class,'upload']);
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);
Route::get('/getArea',[LoginController::class,'getArea']);
Route::get('/download',[LoginController::class,'download']);

Route::post('/importFile',[LoginController::class,'importFile']);

//用户管理
Route::group(['prefix'=>'user'],function(Router $router){

    $router->get('/lst',[UserController::class,'lst']);
    $router->post('/add',[UserController::class,'add']);
    $router->get('/del',[UserController::class,'del']);
    $router->post('/change',[UserController::class,'change']);
    $router->get('/detail',[UserController::class,'detail']);

});

//rbac权限管理
Route::group(['prefix'=>'rbac'],function(Router $router){

    $router->get('/loginLog',[LoginController::class,'loginLog']);

    $router->group(['prefix'=>'permission'],function ($router){
        $router->get('/lst',[PermissionController::class,'lst']);
        $router->post('/add',[PermissionController::class,'add']);
        $router->get('/detail',[PermissionController::class,'detail']);
        $router->get('/del',[PermissionController::class,'del']);
    });

    $router->group(['prefix'=>'role'],function ($router){
        $router->get('/lst',[RoleController::class,'lst']);
        $router->post('/add',[RoleController::class,'add']);
        $router->get('/del',[RoleController::class,'del']);
        $router->get('/detail',[RoleController::class,'detail']);
    });

    $router->group(['prefix'=>'guardUser'], function ($router){
        $router->get('/getGuardUser',[GuardUserController::class,'getGuardUser']);
        $router->get('/lst',[GuardUserController::class,'lst']);
        $router->post('/add',[GuardUserController::class,'add']);
        $router->post('/edit',[GuardUserController::class,'edit']);
        $router->get('/del',[GuardUserController::class,'del']);
        $router->get('/change',[GuardUserController::class,'change']);
        $router->post('/modifyPassword',[GuardUserController::class,'modifyPassword']);
        $router->post('/coverPassword',[GuardUserController::class,'coverPassword']);
    });

});





